"""Import header used by generated scripts when not embedding the full snippet.
This sets project root on sys.path and imports the helper API from src.bootstrap_helpers
so generated scripts can remain minimal (one-line import equivalent).
"""
from pathlib import Path
import sys

# Ensure project root is on sys.path so `from src.bootstrap_helpers import ...` works
ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT))
try:
    from src.bootstrap_helpers import (
        start, end, progress, set_plot_style, detect_chinese_font,
        force_chinese_font, print_summary_table, log_saved, Parallel, delayed,
        get_logger, load_config_from_file
    )
except Exception:
    # If import fails (e.g., running as standalone), provide no-op fallbacks
    def get_logger(name: str = "gmt-template", level: str = "INFO"):
        import logging
        logger = logging.getLogger(name)
        if not logger.handlers:
            logger.addHandler(logging.StreamHandler())
        logger.setLevel(level)
        return logger

    def load_config_from_file(path: str = "config.yaml"):
        return {}
